package main.java.br.com.projeto.domain.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import main.java.br.com.projeto.domain.entity.Parcela;

public class DaoParcela extends Dao<Parcela>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1647770406422111306L;
	
	public DaoParcela() {
		super(Parcela.class);
	}
	
	public List<Parcela> listParcelasByCondicaoPagamentoId(Long condicaoId) {
		String hql = "select parcela from Parcela parcela "
				+ "join parcela.condicaoPagamento condicao "
				+ "where condicao.id = :condicaoId";

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("condicaoId", condicaoId);
		return this.findOneResult(hql, parameters);
	}
}
